home *** CD-ROM | disk | FTP | other *** search
- /* Listing 8 */
-
- /*****************************************************
- DMA.H
-
- Header file containing basic number defs and
- function prototypes for working with the DMA
- controller.
-
- Copyright Don Bradley, 1991.
-
- Permission is granted for used of these routines
- in any manner as long as this copyright notice is
- included.
-
- Tested using Quick C 2.5 and MSC 6.0 on a
- Toshiba T5200.
-
- *****************************************************/
-
- #define TRUE 1
- #define FALSE 0
-
- /* mask defines */
- #define DMA_ENABLE 0x00
- #define DMA_DISABLE 0x04
- #define DMA_DEMAND_MODE 0x00
- #define DMA_SINGLE_MODE 0x40
- #define DMA_ADDRESS_INC 0x00
- #define DMA_ADDRESS_DEC 0x20
- #define DMA_CONTINUOUS_ENABLE 0x10
- #define DMA_CONTINUOUS_DISABLE 0x00
- #define DMA_ADC_TRANSFER 0x04
- #define DMA_DAC_TRANSFER 0x08
-
- int dma(int dma_channel, int mode, int far *buffer,
- unsigned int buffer_len);
- void disable_dma(int chan);
- void enable_dma(int chan);
- int far *alloc_dma_buffer(int dma_chn,
- unsigned int size);
- void free_dma_buffer(int dma_chn);
-
-
-